package cn.edu.nwpu.manager.bean;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.HashMap;

/**
 * @author Hutengzhong
 * @version 1.0.0
 * @title Academy 学院表
 * @description TODO
 * @date 2023/9/16
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Academy {

    private Integer id;
    private String academyName;
    private String academyLeader;
    private Integer isDeleted;

    public Academy(HashMap<String, String> parameters ){
        if (parameters == null){
            return;
        }else {
            try {
                // parameters={academyName=计算机}
                if (parameters.containsKey("id")){
                    id = Integer.parseInt((String) parameters.get("id"));
                }
                if (parameters.containsKey("academyName")){
                    academyName = (String) parameters.get("academyName");
                }
                if (parameters.containsKey("academyLeader")){
                    academyLeader = (String) parameters.get("academyLeader");
                }
            }catch (Exception e){
                System.out.println("前端传递参数转化异常: 参考类型异常");
            }
        }
    }
}
